Repository navigation
Conversation
Reviewer's GuideUIMake Qt6 HighlightPanel a Control and use its background Rectangle as contentItem, allowing typed highlight colors to resolve from the panel’s own palette.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
TAG Bot New tag: 6.7.51 |
7d93864 to
1b23d50
Compare
1b23d50 to
0064daf
Compare
|
TAG Bot New tag: 6.7.52 |
0064daf to
4c74707
Compare
4c74707 to
3d521a4
Compare
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, Ivy233 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
TAG Bot New tag: 6.7.53 |
HighlightPanel is used as ListView.highlight in Menu/ArrowListView without a Control ancestor. Its backgroundColor is a typed color (D.Color.Highlight), and DQuickControlColorSelector left it invalid when no Control was found, printing "ColorSelector: The ... is an invalid color" and rendering an opaque black highlight. Derive HighlightPanel from Control and use the background Rectangle as its contentItem, so ColorSelector finds a Control on the panel itself and resolves the typed color from its palette. This fixes all HighlightPanel uses without a caller-side wrapper or an application-wide color fallback. Because the panel is now its own control, it resolves palette/state from itself; enclosing Control hover/pressed/disabled state is not inherited. In-tree uses activate HighlightPanel for checked/highlighted state, so this keeps their normal appearance. 为 HighlightPanel 增加 Control 基类 HighlightPanel 在 Menu/ArrowListView 中作为 ListView.highlight 使用, 父链上没有 Control。其 backgroundColor 是类型化颜色 (D.Color.Highlight),找不到 Control 时 DQuickControlColorSelector 会返回无效颜色,打印 "ColorSelector: The ... is an invalid color", 并把高亮渲染成不透明黑色。 将 HighlightPanel 的根改为 Control,并把背景 Rectangle 作为其 contentItem,使 ColorSelector 能在面板自身找到 Control,并从自己的 palette 解析类型化颜色。这样无需调用方套壳,也无需增加应用级颜色兜底。 注意:面板现在以自身作为 Control,不再继承外层 Control 的 hovered/pressed/disabled 状态;库内使用点主要依赖 checked/highlighted 状态,因此正常外观保持不变。 PMS: TASK-394335
3d521a4 to
ecd53ff
Compare
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 语法正确,逻辑清晰 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 代码结构清晰,注释完整 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 性能良好,资源使用合理 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 存在0个安全漏洞 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例本报告由 AI 代码审查工具自动生成 |
|
TAG Bot New tag: 6.7.54 |
|
TAG Bot New tag: 6.7.55 |
HighlightPanelis used asListView.highlightinMenu/ArrowListViewwithout aQQuickControlancestor. ItsbackgroundColoris a typed color (D.Color.Highlight), andDQuickControlColorSelectorleft it invalid when no Control was found, printingColorSelector: The ... is an invalid colorand rendering an opaque black highlight.Derive
HighlightPanelfromControland use the backgroundRectangleas itscontentItem, soColorSelectorfinds a Control on the panel itself and resolves the typed color from its palette. This fixes allHighlightPaneluses without caller-side wrappers or an application-wide color fallback.Trade-off: the panel now resolves palette/state from itself and no longer inherits
hovered/pressed/disabledfrom an enclosing Control. In-tree uses activateHighlightPanelfor checked/highlighted state, so their normal appearance is preserved. The Qt5HighlightPanelis unchanged.Verification:
D.HighlightPanel: no warning,backgroundColor = #308cc6.ListView.highlightgeometry before/after: highlight0,0 180x30; background/contentItem0,0 180x30.ut_ColorSelector.*4/4 passed.loadQml/ut_dtkDeclarativeQmls.*90/90 passed.修复:将 HighlightPanel 的根改为 Control
HighlightPanel在Menu/ArrowListView中作为ListView.highlight使用,父链上没有QQuickControl。其backgroundColor是类型化颜色(D.Color.Highlight),找不到 Control 时DQuickControlColorSelector会返回无效颜色,打印ColorSelector: The ... is an invalid color,并把高亮渲染成不透明黑色。将
HighlightPanel的根改为Control,并把背景Rectangle作为其contentItem,使ColorSelector能在面板自身找到 Control,并从自己的 palette 解析类型化颜色。这样无需调用方套壳,也无需增加应用级颜色兜底。注意:面板现在以自身作为 Control,不再继承外层 Control 的
hovered/pressed/disabled状态;库内使用点主要依赖 checked/highlighted 状态,正常外观保持不变。Qt5 的HighlightPanel未改动。验证:
D.HighlightPanel:无 warning,backgroundColor = #308cc6。ListView.highlight修改前后几何:highlight0,0 180x30;background/contentItem0,0 180x30。ut_ColorSelector.*4/4 通过。loadQml/ut_dtkDeclarativeQmls.*90/90 通过。PMS: TASK-394335
Summary by Sourcery
Make Qt6 HighlightPanel derive from Control to reliably resolve its palette highlight color when used as a ListView highlight.
Bug Fixes:
Enhancements: